#ifndef _ROS_learning_test_EPS_h
#define _ROS_learning_test_EPS_h

#include <stdint.h>
#include <string.h>
#include <stdlib.h>
#include "ros/msg.h"

namespace learning_test
{

  class EPS : public ros::Msg
  {
    public:
      typedef bool _ter_sw_type;
      _ter_sw_type ter_sw;
      typedef bool _fw_sw_type;
      _fw_sw_type fw_sw;
      typedef bool _mag_sw_type;
      _mag_sw_type mag_sw;
      typedef bool _pay_sw_type;
      _pay_sw_type pay_sw;
      enum { ON =  1 };
      enum { OFF =  0 };

    EPS():
      ter_sw(0),
      fw_sw(0),
      mag_sw(0),
      pay_sw(0)
    {
    }

    virtual int serialize(unsigned char *outbuffer) const override
    {
      int offset = 0;
      union {
        bool real;
        uint8_t base;
      } u_ter_sw;
      u_ter_sw.real = this->ter_sw;
      *(outbuffer + offset + 0) = (u_ter_sw.base >> (8 * 0)) & 0xFF;
      offset += sizeof(this->ter_sw);
      union {
        bool real;
        uint8_t base;
      } u_fw_sw;
      u_fw_sw.real = this->fw_sw;
      *(outbuffer + offset + 0) = (u_fw_sw.base >> (8 * 0)) & 0xFF;
      offset += sizeof(this->fw_sw);
      union {
        bool real;
        uint8_t base;
      } u_mag_sw;
      u_mag_sw.real = this->mag_sw;
      *(outbuffer + offset + 0) = (u_mag_sw.base >> (8 * 0)) & 0xFF;
      offset += sizeof(this->mag_sw);
      union {
        bool real;
        uint8_t base;
      } u_pay_sw;
      u_pay_sw.real = this->pay_sw;
      *(outbuffer + offset + 0) = (u_pay_sw.base >> (8 * 0)) & 0xFF;
      offset += sizeof(this->pay_sw);
      return offset;
    }

    virtual int deserialize(unsigned char *inbuffer) override
    {
      int offset = 0;
      union {
        bool real;
        uint8_t base;
      } u_ter_sw;
      u_ter_sw.base = 0;
      u_ter_sw.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0);
      this->ter_sw = u_ter_sw.real;
      offset += sizeof(this->ter_sw);
      union {
        bool real;
        uint8_t base;
      } u_fw_sw;
      u_fw_sw.base = 0;
      u_fw_sw.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0);
      this->fw_sw = u_fw_sw.real;
      offset += sizeof(this->fw_sw);
      union {
        bool real;
        uint8_t base;
      } u_mag_sw;
      u_mag_sw.base = 0;
      u_mag_sw.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0);
      this->mag_sw = u_mag_sw.real;
      offset += sizeof(this->mag_sw);
      union {
        bool real;
        uint8_t base;
      } u_pay_sw;
      u_pay_sw.base = 0;
      u_pay_sw.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0);
      this->pay_sw = u_pay_sw.real;
      offset += sizeof(this->pay_sw);
     return offset;
    }

    virtual const char * getType() override { return "learning_test/EPS"; };
    virtual const char * getMD5() override { return "80448f07f399912e2ce64c9be3ad28cc"; };

  };

}
#endif
